#define _CRT_SECURE_NO_WARNINGS 1
#include"String.h"
yws::string::string(const char* str = "")

	:_size(strlen(str))
		, _capacity(_size)
	{
		_str = new char[_capacity + 1];
		strcpy(_str, str);
	}

yws::string::string(const string& s)
{
	_str = s._str;
	_size = s._size;
	_capacity = s._capacity;
}
yws::string::~string()
{
	delete[] _str;
	_str = nullptr;
	_size = _capacity = 0;
}
yws::string& yws::string::operator=(const string& s)
{
	_str = s._str;
	_size = s._size;
	_capacity = s._capacity;
	return *this;
}
void yws::string::reserve(size_t n)
{
	if (n > _capacity)
	{
		char* tmp = new char[n + 1];
		strcpy(tmp, _str);
		delete[] _str;
		_str = tmp;

		_capacity = n;
	}
}
void yws::string::push_back(char c)
{
	if (_size == _capacity)
	{
		reserve(_capacity == 0 ? 4 : _capacity * 2);
	}
	_str[_size] = c;
	++_size;
	_str[_size] = '\0';
}
void yws::string::append(const char* str)
{
	size_t len = strlen(str);
	if (_size + len > _capacity)
	{
		reserve(_size + len);
	}

	strcpy(_str + _size, str);
	_size += len;
}
yws::string& yws::string::operator+=(char c)
{

}
yws::string& yws::string::operator+=(const char* str)
{

}
void yws::string::clear()
{

}
void yws::string::swap(string& s)
{

}
const char* yws::string::c_str()const
{

}
size_t yws::string::size()const
{

}
size_t yws::string::capacity()const
{

}
bool yws::string::empty()const
{

}
void yws::string::resize(size_t n, char c = '\0')
{

}
void yws::string::reserve(size_t n)
{

}
char& yws::string::operator[](size_t index)
{

}
const char& yws::string::operator[](size_t index)const
{

}
bool yws::string::operator<(const string& s)
{

}
bool yws::string::operator<=(const string& s)
{

}
bool yws::string::operator>(const string& s)
{

}
bool yws::string::operator>=(const string& s)
{

}
bool yws::string::operator==(const string& s)
{

}
bool yws::string::operator!=(const string& s)
{

}
size_t yws::string::find(char c, size_t pos = 0) const
{

}
size_t yws::string::find(const char* s, size_t pos = 0) const
{

}
yws::string& yws::string::insert(size_t pos, char c)
{

}
yws::string& yws::string::insert(size_t pos, const char* str)
{

}
yws::string& yws::string::erase(size_t pos, size_t len)
{

}


